home *** CD-ROM | disk | FTP | other *** search
- # Jedi Knight Cog Script
- #
- # CLASS_BOXTURRET4.COG
- #
- # Class COG for a turret
- #
- # Alternate the firepoint between two points.
- #
- # [YB]
- #
- # (C) 1997 LucasArts Entertainment Co. All Rights Reserved
-
-
- symbols
-
- template powerup=+dEnergyCell local
- thing newThing local
- int player local
-
- #message fire
- #message created
- message killed mask=0xfff
- message skill
- message damaged
-
- end
-
- # ========================================================================================
-
- code
-
- //created:
- // SetThingFireOffset(GetSenderRef(), '0.2 0.0 0.0');
- // SetThingUserData(GetSenderRef(), 0);
- // Return;
-
- # ........................................................................................
-
- //fire:
- // if(GetThingUserData(GetSenderRef()) == 0)
- // {
- // SetThingFireOffset(GetSenderRef(), '-0.2 0.0 0.0');
- // SetThingUserData(GetSenderRef(), 1);
- // }
- // else
- // {
- // SetThingFireOffset(GetSenderRef(), '0.2 0.0 0.0');
- // SetThingUserData(GetSenderRef(), 0);
- // }
- //
- // Return;
-
- # ........................................................................................
-
- killed:
- rval = Rand();
- if(rval < 0.2)
- {
- newThing = CreateThing(powerup, GetSenderRef());
- SetLifeleft(newThing, 200.0);
- }
-
- Return;
-
- # ........................................................................................
-
- skill:
- ReturnEx(-1);
- Return;
-
- # ........................................................................................
-
- damaged:
- if(GetParam(1) == 1) ReturnEx(0); // turrets immune to impact damage
-
- player = GetLocalPlayerThing();
-
- if(GetThingParent(GetSourceRef()) == player)
- {
- if(GetCurWeapon(player) == 1)
- {
- if(GetThingHealth(player) > 1)
- {
- DamageThing(player, 1, 0x1, player);
- }
- }
- }
-
- Return;
-
- end
-
-
-